# -*- coding: utf-8 -*-

broker_url = "redis://172.17.0.1:46379/7"
# set task queue
result_backend = "redis://172.17.0.1:46379/8"

# 可能直接在任务执行的时候制定队列是最优雅的
# 设定task routing
task_routes = {
    "domain.ai_edit.tasks.task_list_public_materials": {'queue': 'pu_task'},
    "domain.ai_edit.tasks.task_process_ai_editor": {'queue': 'ai_task'},
    "domain.ai_edit.tasks.test_task_list_public_materials": {'queue': 'default'},
    "domain.ai_edit.tasks.test_task_process_ai_editor": {'queue': 'default'},
    "domain.ai_edit.tasks.task_init_user_avatar": {'queue': 'default'},

}
task_default_queue = "default"

task_queue_max_priority = 10
task_default_priority = 5
worker_prefetch_multiplier = 1  # 任务预取数量，设置为1可以避免任务被分配到不同的worker，导致任务执行顺序错乱
worker_concurrency = 3

broker_transport_options = {
    "visibility_timeout": 1200,  # in seconds
    # 'visibility_timeout': 120,  # in seconds
    "queue_order_strategy": "priority",
}

# 时区
timezone = 'Asia/Shanghai'
# 是否使用UTC
enable_utc = True
